package com.beyond.market.favorites.service.impl;

import com.beyond.market.favorites.dao.FavoritesMapper;
import com.beyond.market.favorites.domain.Favorites;
import com.beyond.market.favorites.service.FavoritesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;

@Service
public class FavoritesServiceImpl implements FavoritesService {

    @Autowired
    private FavoritesMapper favoritesMapper;

    @Override
    public int save(Favorites favorites) throws SQLException {
        return favoritesMapper.save(favorites);
    }

    @Override
    public int remove(Integer favortiesId) throws SQLException {
        return favoritesMapper.remove(favortiesId);
    }

    @Override
    public int update(Favorites favorites) throws SQLException {
        return favoritesMapper.update(favorites);
    }

    @Override
    public Favorites getByPrimaryKey(Integer favortiesId) throws SQLException {
        return favoritesMapper.getByPrimaryKey(favortiesId);
    }

    @Override
    public List<Favorites> getByUser(Integer userId) throws SQLException {
        return favoritesMapper.getByUser(userId);
    }


}
